package cc.yugu.yhdw.common.constant;

import java.util.HashMap;
import java.util.Map;
/**
 * 定义所需枚举类
 * 
 * @Date:Created in 2018/7/24 17:39
 * @Author:
 * @Modified By: zjn 2018/7/24 17:39
 */ 
public class ConstEnum {

    public enum Module {
        BASIC(1, "基础"),
        HDW(2, "换电网");

        private final int value;
        private final String name;

        Module(int value, String name) {
            this.value = value;
            this.name = name;
        }

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    public enum Node {
        NODE_YHDW("yhdw"),
        NODE_WEB_SERVER("/web-server"),
        NODE_WEB_SERVER_CHILDREN("/web-server-"),
        NODE_TERMINAL_SERVER("/terminal-server"),
        NODE_TERMINAL_SERVER_CHILDREN("/terminal-server-"),
        NODE_SERVICE_SERVER("/service-server"),
        NODE_SERVICE_SERVER_CHILDREN("/service-server-"),
        NODE_APP_SERVER("/app-server"),
        NODE_APP_SERVER_CHILDREN("/app-server-"),
        NODE_TASK("/task"),
        NODE_SEND_SMS_TASK("/send-sms-task"),
        NODE_SCAN_ORDER_TASK("/check-scan-order-task"),
        NODE_CLEAN_ORDER_ID_TASK("/clean-order-id-task"),
        NODE_TOTAL_AGENT_MONEY_TASK("/total-agent-money-task"),
        NODE_TEN_MINUTE_TASK("ten-minute-task"),
        NODE_ZERO_TEN_TASK("zero-ten-task"),
        NODE_TOTAL_SITE_MONEY_TASK("/total-site-money-task"),
        NODE_CLEAN_HISTORY_DATA_TASK("/clean-history-data-task"),
        NODE_REFRESH_AGENT_STATISTIC_TASK("refresh-agent-statistic-task"),
        NODE_REFRESH_ONLINE_TASK("refresh-online-task"),
        NODE_WEIXIN_SEND_SMS_TASK("weixin-send-sms-task"),
        NODE_GETUI_PUSH_TASK("getui-push-task"),
        NODE_REPORT_STATS_TASK("report-stats-task"),
        NODE_RESERVATION_TASK("reservation-task"),
        NODE_ORDER_HISTORY_TASK("order-history-task");

        private final String value;

        Node(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    }

    public enum ContentType {
        JSON("application/json;charset=UTF-8");

        private final String value;

        ContentType(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    }


    public enum Flag {
        TRUE(1, "是"), FALSE(0, "否");

        private final int value;
        private final String name;

        Flag(int value, String name) {
            this.value = value;
            this.name = name;
        }

        public String getName() {
            return name;
        }

        public Integer getValue() {
            return value;
        }
    }

    public enum SystemConfigKey {
        ALIPAY_ACCOUNT_NAME("alipay.account.name"),
        ALIPAY_PARTNER("alipay.partner"),
        ALIPAY_SELLER("alipay.seller"),
        ALIPAY_SECRET_KEY("alipay.secret.key"),
        ALIPAY_APP_RSA_PRIVATE("alipay.app.rsa.private"),
        ALIPAY_APP_RSA_PRIVATE_PKCS8("alipay.app.rsa.private.pkcs8"),
        ALIPAY_APP_RSA_PUBLIC("alipay.app.rsa.public"),
        ALIPAY_APP_ID("alipay.app.id"),
        ALIPAY_PUBLIC("alipay.public"),
        STATIC_URL("static.url"),

        WX_APP_ID("wx.app.id"),
        WX_APP_SECRET("wx.app.secret"),
        WX_TOKEN("wx.token"),
        WX_AES_KEY("wx.aes.key"),
        WX_PARTNER_ID("wx.partner.id"),
        WX_PARTNER_KEY("wx.partner.key"),

        BATTERY_REPORT_INTERVAL("battery.report.interval"),
        BATTERY_STANDARD_ELECTRICITY("battery.standard.electricity"),
        BATTERY_STANDARD_TOTALDISTANCE("battery.standard.totalDistance"),
        BATTERY_STANDARD_ISSUED("battery.standard.issued"),

        SYSTEM_TEL("system.tel"),
        BATTERY_FOREGIFT_REFUND_APPLY("battery.foregift.refund.apply"),
        BATTERY_FOREGIFT_REFUND_OK("battery.foregift.refund.ok"),
        BATTERY_FOREGIFT_REFUND_REFUSE("battery.foregift.refund.refuse"),

        ORDER_PREFIX("order.prefix"),

        BAIDU_MAP_KEY("baidu.map.key"),

        PUSH_APPID("push.appId"),
        PUSH_APPKEY("push.appKey"),
        PUSH_MASTERSECRET("push.masterSecret"),
        PUSH_HOST("push.host"),

        CABINET_BOX_EMPTY("cabinet.box.empty"),
        CABINET_BOX_FULL("cabinet.box.full"),
        ;

        private final String value;

        SystemConfigKey(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    }

    public enum Gender {
        MALE((byte) 1, "男"), FEMALE((byte) 2, "女");

        private final byte value;
        private final String name;

        Gender(byte value, String name) {
            this.value = value;
            this.name = name;
        }

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    public enum VideoConvertStatus {
        WAIT(1, "等待优化"),
        RUNNING(2, "优化中"),
        SUCCESS(3, "优化完成"),
        FAIL(4, "优化失败");

        private final int value;
        private final String name;

        VideoConvertStatus(int value, String name) {
            this.value = value;
            this.name = name;
        }
        private static Map<Integer, String> map = new HashMap<Integer, String>();
        static {
            for (VideoConvertStatus s : VideoConvertStatus.values()) {
                map.put(s.getValue(), s.getName());
            }
        }

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }

        public static  String getName(int value) {
            return map.get(value);
        }
    }

    public enum PayType {
        BALANCE(1, "余额"),
        ALIPAY(2,"支付宝"),
        WEIXIN(3, "微信"),
        PACKET(4, "换电套餐");


        private final int value;
        private final String name;

        private PayType(int value, String name){
            this.value = value;
            this.name = name;
        }

        private static Map<Integer, String> map = new HashMap<Integer, String>();
        static {
            for (PayType e : PayType.values()) {
                map.put(e.getValue(), e.getName());
            }
        }

        public static String getName(int value) {
            return map.get(value);
        }

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

}
